#!/usr/bin/perl
use CGI;
use cfg;
my $q=CGI->new;
$q->header(-charset=>'utf-8');

if(cfg::get('auth_type') eq "syno"){
	$login_name=`/usr/syno/synoman/webman/modules/authenticate.cgi`;
	$login_name=~s/\n//;
	if($login_name eq "admin"){
		print $q->redirect(-url=>'./svnadmin.cgi');
		exit 0;
	}
}
if(cfg::get('auth_type') eq "ip"){
	if(grep $_ eq $q->remote_addr(), cfg::allow_ip()){
		print $q->redirect(-url=>'./svnadmin.cgi');
		exit 0;
	}
}
print $q->redirect(-url=>'./svnuser.cgi');

